<?php

/**
 * NalogProdaje form base class.
 *
 * @package    marketing
 * @subpackage form
 * @author     Your name here
 */
class BaseNalogProdajeForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                => new sfWidgetFormInputHidden(),
      'datum_realizacije' => new sfWidgetFormDateTime(),
      'odgovorno_lice'    => new sfWidgetFormPropelChoice(array('model' => 'Admin', 'add_empty' => false)),
      'narudzbina_id'     => new sfWidgetFormPropelChoice(array('model' => 'Narudzbina', 'add_empty' => false)),
      'created_at'        => new sfWidgetFormDateTime(),
      'updated_at'        => new sfWidgetFormDateTime(),
      'deleted_at'        => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                => new sfValidatorPropelChoice(array('model' => 'NalogProdaje', 'column' => 'id', 'required' => false)),
      'datum_realizacije' => new sfValidatorDateTime(),
      'odgovorno_lice'    => new sfValidatorPropelChoice(array('model' => 'Admin', 'column' => 'id')),
      'narudzbina_id'     => new sfValidatorPropelChoice(array('model' => 'Narudzbina', 'column' => 'id')),
      'created_at'        => new sfValidatorDateTime(array('required' => false)),
      'updated_at'        => new sfValidatorDateTime(array('required' => false)),
      'deleted_at'        => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('nalog_prodaje[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'NalogProdaje';
  }


}
